{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"style\", \"className\", \"title\", \"eventKey\", \"warnKey\", \"disabled\", \"internalPopupClose\", \"children\", \"itemIcon\", \"expandIcon\", \"popupClassName\", \"popupOffset\", \"onClick\", \"onMouseEnter\", \"onMouseLeave\", \"onTitleClick\", \"onTitleMouseEnter\", \"onTitleMouseLeave\"],\n  _excluded2 = [\"active\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Overflow from 'rc-overflow';\nimport warning from \"rc-util/es/warning\";\nimport SubMenuList from \"./SubMenuList\";\nimport { parseChildren } from \"../utils/nodeUtil\";\nimport MenuContextProvider, { MenuContext } from \"../context/MenuContext\";\nimport useMemoCallback from \"../hooks/useMemoCallback\";\nimport PopupTrigger from \"./PopupTrigger\";\nimport Icon from \"../Icon\";\nimport useActive from \"../hooks/useActive\";\nimport { warnItemProp } from \"../utils/warnUtil\";\nimport useDirectionStyle from \"../hooks/useDirectionStyle\";\nimport InlineSubMenuList from \"./InlineSubMenuList\";\nimport { PathTrackerContext, PathUserContext, useFullPath, useMeasure } from \"../context/PathContext\";\nimport { useMenuId } from \"../context/IdContext\";\nimport PrivateContext from \"../context/PrivateContext\";\nvar InternalSubMenu = function InternalSubMenu(props) {\n  var _classNames;\n  var style = props.style,\n    className = props.className,\n    title = props.title,\n    eventKey = props.eventKey,\n    warnKey = props.warnKey,\n    disabled = props.disabled,\n    internalPopupClose = props.internalPopupClose,\n    children = props.children,\n    itemIcon = props.itemIcon,\n    expandIcon = props.expandIcon,\n    popupClassName = props.popupClassName,\n    popupOffset = props.popupOffset,\n    onClick = props.onClick,\n    onMouseEnter = props.onMouseEnter,\n    onMouseLeave = props.onMouseLeave,\n    onTitleClick = props.onTitleClick,\n    onTitleMouseEnter = props.onTitleMouseEnter,\n    onTitleMouseLeave = props.onTitleMouseLeave,\n    restProps = _objectWithoutProperties(props, _excluded);\n  var domDataId = useMenuId(eventKey);\n  var _React$useContext = React.useContext(MenuContext),\n    prefixCls = _React$useContext.prefixCls,\n    mode = _React$useContext.mode,\n    openKeys = _React$useContext.openKeys,\n    contextDisabled = _React$useContext.disabled,\n    overflowDisabled = _React$useContext.overflowDisabled,\n    activeKey = _React$useContext.activeKey,\n    selectedKeys = _React$useContext.selectedKeys,\n    contextItemIcon = _React$useContext.itemIcon,\n    contextExpandIcon = _React$useContext.expandIcon,\n    onItemClick = _React$useContext.onItemClick,\n    onOpenChange = _React$useContext.onOpenChange,\n    onActive = _React$useContext.onActive;\n  var _React$useContext2 = React.useContext(PrivateContext),\n    _internalRenderSubMenuItem = _React$useContext2._internalRenderSubMenuItem;\n  var _React$useContext3 = React.useContext(PathUserContext),\n    isSubPathKey = _React$useContext3.isSubPathKey;\n  var connectedPath = useFullPath();\n  var subMenuPrefixCls = \"\".concat(prefixCls, \"-submenu\");\n  var mergedDisabled = contextDisabled || disabled;\n  var elementRef = React.useRef();\n  var popupRef = React.useRef(); // ================================ Warn ================================\n\n  if (process.env.NODE_ENV !== 'production' && warnKey) {\n    warning(false, 'SubMenu should not leave undefined `key`.');\n  } // ================================ Icon ================================\n\n  var mergedItemIcon = itemIcon || contextItemIcon;\n  var mergedExpandIcon = expandIcon || contextExpandIcon; // ================================ Open ================================\n\n  var originOpen = openKeys.includes(eventKey);\n  var open = !overflowDisabled && originOpen; // =============================== Select ===============================\n\n  var childrenSelected = isSubPathKey(selectedKeys, eventKey); // =============================== Active ===============================\n\n  var _useActive = useActive(eventKey, mergedDisabled, onTitleMouseEnter, onTitleMouseLeave),\n    active = _useActive.active,\n    activeProps = _objectWithoutProperties(_useActive, _excluded2); // Fallback of active check to avoid hover on menu title or disabled item\n\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    childrenActive = _React$useState2[0],\n    setChildrenActive = _React$useState2[1];\n  var triggerChildrenActive = function triggerChildrenActive(newActive) {\n    if (!mergedDisabled) {\n      setChildrenActive(newActive);\n    }\n  };\n  var onInternalMouseEnter = function onInternalMouseEnter(domEvent) {\n    triggerChildrenActive(true);\n    onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({\n      key: eventKey,\n      domEvent: domEvent\n    });\n  };\n  var onInternalMouseLeave = function onInternalMouseLeave(domEvent) {\n    triggerChildrenActive(false);\n    onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({\n      key: eventKey,\n      domEvent: domEvent\n    });\n  };\n  var mergedActive = React.useMemo(function () {\n    if (active) {\n      return active;\n    }\n    if (mode !== 'inline') {\n      return childrenActive || isSubPathKey([activeKey], eventKey);\n    }\n    return false;\n  }, [mode, active, activeKey, childrenActive, eventKey, isSubPathKey]); // ========================== DirectionStyle ==========================\n\n  var directionStyle = useDirectionStyle(connectedPath.length); // =============================== Events ===============================\n  // >>>> Title click\n\n  var onInternalTitleClick = function onInternalTitleClick(e) {\n    // Skip if disabled\n    if (mergedDisabled) {\n      return;\n    }\n    onTitleClick === null || onTitleClick === void 0 ? void 0 : onTitleClick({\n      key: eventKey,\n      domEvent: e\n    }); // Trigger open by click when mode is `inline`\n\n    if (mode === 'inline') {\n      onOpenChange(eventKey, !originOpen);\n    }\n  }; // >>>> Context for children click\n\n  var onMergedItemClick = useMemoCallback(function (info) {\n    onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));\n    onItemClick(info);\n  }); // >>>>> Visible change\n\n  var onPopupVisibleChange = function onPopupVisibleChange(newVisible) {\n    if (mode !== 'inline') {\n      onOpenChange(eventKey, newVisible);\n    }\n  };\n  /**\n   * Used for accessibility. Helper will focus element without key board.\n   * We should manually trigger an active\n   */\n\n  var onInternalFocus = function onInternalFocus() {\n    onActive(eventKey);\n  }; // =============================== Render ===============================\n\n  var popupId = domDataId && \"\".concat(domDataId, \"-popup\"); // >>>>> Title\n\n  var titleNode = /*#__PURE__*/React.createElement(\"div\", _extends({\n    role: \"menuitem\",\n    style: directionStyle,\n    className: \"\".concat(subMenuPrefixCls, \"-title\"),\n    tabIndex: mergedDisabled ? null : -1,\n    ref: elementRef,\n    title: typeof title === 'string' ? title : null,\n    \"data-menu-id\": overflowDisabled && domDataId ? null : domDataId,\n    \"aria-expanded\": open,\n    \"aria-haspopup\": true,\n    \"aria-controls\": popupId,\n    \"aria-disabled\": mergedDisabled,\n    onClick: onInternalTitleClick,\n    onFocus: onInternalFocus\n  }, activeProps), title, /*#__PURE__*/React.createElement(Icon, {\n    icon: mode !== 'horizontal' ? mergedExpandIcon : null,\n    props: _objectSpread(_objectSpread({}, props), {}, {\n      isOpen: open,\n      // [Legacy] Not sure why need this mark\n      isSubMenu: true\n    })\n  }, /*#__PURE__*/React.createElement(\"i\", {\n    className: \"\".concat(subMenuPrefixCls, \"-arrow\")\n  }))); // Cache mode if it change to `inline` which do not have popup motion\n\n  var triggerModeRef = React.useRef(mode);\n  if (mode !== 'inline' && connectedPath.length > 1) {\n    triggerModeRef.current = 'vertical';\n  } else {\n    triggerModeRef.current = mode;\n  }\n  if (!overflowDisabled) {\n    var triggerMode = triggerModeRef.current; // Still wrap with Trigger here since we need avoid react re-mount dom node\n    // Which makes motion failed\n\n    titleNode = /*#__PURE__*/React.createElement(PopupTrigger, {\n      mode: triggerMode,\n      prefixCls: subMenuPrefixCls,\n      visible: !internalPopupClose && open && mode !== 'inline',\n      popupClassName: popupClassName,\n      popupOffset: popupOffset,\n      popup: /*#__PURE__*/React.createElement(MenuContextProvider // Special handle of horizontal mode\n      , {\n        mode: triggerMode === 'horizontal' ? 'vertical' : triggerMode\n      }, /*#__PURE__*/React.createElement(SubMenuList, {\n        id: popupId,\n        ref: popupRef\n      }, children)),\n      disabled: mergedDisabled,\n      onVisibleChange: onPopupVisibleChange\n    }, titleNode);\n  } // >>>>> List node\n\n  var listNode = /*#__PURE__*/React.createElement(Overflow.Item, _extends({\n    role: \"none\"\n  }, restProps, {\n    component: \"li\",\n    style: style,\n    className: classNames(subMenuPrefixCls, \"\".concat(subMenuPrefixCls, \"-\").concat(mode), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-open\"), open), _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-active\"), mergedActive), _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-selected\"), childrenSelected), _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-disabled\"), mergedDisabled), _classNames)),\n    onMouseEnter: onInternalMouseEnter,\n    onMouseLeave: onInternalMouseLeave\n  }), titleNode, !overflowDisabled && /*#__PURE__*/React.createElement(InlineSubMenuList, {\n    id: popupId,\n    open: open,\n    keyPath: connectedPath\n  }, children));\n  if (_internalRenderSubMenuItem) {\n    listNode = _internalRenderSubMenuItem(listNode, props, {\n      selected: childrenSelected,\n      active: mergedActive,\n      open: open,\n      disabled: mergedDisabled\n    });\n  } // >>>>> Render\n\n  return /*#__PURE__*/React.createElement(MenuContextProvider, {\n    onItemClick: onMergedItemClick,\n    mode: mode === 'horizontal' ? 'vertical' : mode,\n    itemIcon: mergedItemIcon,\n    expandIcon: mergedExpandIcon\n  }, listNode);\n};\nexport default function SubMenu(props) {\n  var eventKey = props.eventKey,\n    children = props.children;\n  var connectedKeyPath = useFullPath(eventKey);\n  var childList = parseChildren(children, connectedKeyPath); // ==================== Record KeyPath ====================\n\n  var measure = useMeasure(); // eslint-disable-next-line consistent-return\n\n  React.useEffect(function () {\n    if (measure) {\n      measure.registerPath(eventKey, connectedKeyPath);\n      return function () {\n        measure.unregisterPath(eventKey, connectedKeyPath);\n      };\n    }\n  }, [connectedKeyPath]);\n  var renderNode; // ======================== Render ========================\n\n  if (measure) {\n    renderNode = childList;\n  } else {\n    renderNode = /*#__PURE__*/React.createElement(InternalSubMenu, props, childList);\n  }\n  return /*#__PURE__*/React.createElement(PathTrackerContext.Provider, {\n    value: connectedKeyPath\n  }, renderNode);\n}","map":{"version":3,"names":["_defineProperty","_extends","_objectSpread","_slicedToArray","_objectWithoutProperties","_excluded","_excluded2","React","classNames","Overflow","warning","SubMenuList","parseChildren","MenuContextProvider","MenuContext","useMemoCallback","PopupTrigger","Icon","useActive","warnItemProp","useDirectionStyle","InlineSubMenuList","PathTrackerContext","PathUserContext","useFullPath","useMeasure","useMenuId","PrivateContext","InternalSubMenu","props","_classNames","style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave","restProps","domDataId","_React$useContext","useContext","prefixCls","mode","openKeys","contextDisabled","overflowDisabled","activeKey","selectedKeys","contextItemIcon","contextExpandIcon","onItemClick","onOpenChange","onActive","_React$useContext2","_internalRenderSubMenuItem","_React$useContext3","isSubPathKey","connectedPath","subMenuPrefixCls","concat","mergedDisabled","elementRef","useRef","popupRef","process","env","NODE_ENV","mergedItemIcon","mergedExpandIcon","originOpen","includes","open","childrenSelected","_useActive","active","activeProps","_React$useState","useState","_React$useState2","childrenActive","setChildrenActive","triggerChildrenActive","newActive","onInternalMouseEnter","domEvent","key","onInternalMouseLeave","mergedActive","useMemo","directionStyle","length","onInternalTitleClick","e","onMergedItemClick","info","onPopupVisibleChange","newVisible","onInternalFocus","popupId","titleNode","createElement","role","tabIndex","ref","onFocus","icon","isOpen","isSubMenu","triggerModeRef","current","triggerMode","visible","popup","id","onVisibleChange","listNode","Item","component","keyPath","selected","SubMenu","connectedKeyPath","childList","measure","useEffect","registerPath","unregisterPath","renderNode","Provider","value"],"sources":["/data/messenger.client/node_modules/rc-menu/es/SubMenu/index.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"style\", \"className\", \"title\", \"eventKey\", \"warnKey\", \"disabled\", \"internalPopupClose\", \"children\", \"itemIcon\", \"expandIcon\", \"popupClassName\", \"popupOffset\", \"onClick\", \"onMouseEnter\", \"onMouseLeave\", \"onTitleClick\", \"onTitleMouseEnter\", \"onTitleMouseLeave\"],\n    _excluded2 = [\"active\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Overflow from 'rc-overflow';\nimport warning from \"rc-util/es/warning\";\nimport SubMenuList from \"./SubMenuList\";\nimport { parseChildren } from \"../utils/nodeUtil\";\nimport MenuContextProvider, { MenuContext } from \"../context/MenuContext\";\nimport useMemoCallback from \"../hooks/useMemoCallback\";\nimport PopupTrigger from \"./PopupTrigger\";\nimport Icon from \"../Icon\";\nimport useActive from \"../hooks/useActive\";\nimport { warnItemProp } from \"../utils/warnUtil\";\nimport useDirectionStyle from \"../hooks/useDirectionStyle\";\nimport InlineSubMenuList from \"./InlineSubMenuList\";\nimport { PathTrackerContext, PathUserContext, useFullPath, useMeasure } from \"../context/PathContext\";\nimport { useMenuId } from \"../context/IdContext\";\nimport PrivateContext from \"../context/PrivateContext\";\n\nvar InternalSubMenu = function InternalSubMenu(props) {\n  var _classNames;\n\n  var style = props.style,\n      className = props.className,\n      title = props.title,\n      eventKey = props.eventKey,\n      warnKey = props.warnKey,\n      disabled = props.disabled,\n      internalPopupClose = props.internalPopupClose,\n      children = props.children,\n      itemIcon = props.itemIcon,\n      expandIcon = props.expandIcon,\n      popupClassName = props.popupClassName,\n      popupOffset = props.popupOffset,\n      onClick = props.onClick,\n      onMouseEnter = props.onMouseEnter,\n      onMouseLeave = props.onMouseLeave,\n      onTitleClick = props.onTitleClick,\n      onTitleMouseEnter = props.onTitleMouseEnter,\n      onTitleMouseLeave = props.onTitleMouseLeave,\n      restProps = _objectWithoutProperties(props, _excluded);\n\n  var domDataId = useMenuId(eventKey);\n\n  var _React$useContext = React.useContext(MenuContext),\n      prefixCls = _React$useContext.prefixCls,\n      mode = _React$useContext.mode,\n      openKeys = _React$useContext.openKeys,\n      contextDisabled = _React$useContext.disabled,\n      overflowDisabled = _React$useContext.overflowDisabled,\n      activeKey = _React$useContext.activeKey,\n      selectedKeys = _React$useContext.selectedKeys,\n      contextItemIcon = _React$useContext.itemIcon,\n      contextExpandIcon = _React$useContext.expandIcon,\n      onItemClick = _React$useContext.onItemClick,\n      onOpenChange = _React$useContext.onOpenChange,\n      onActive = _React$useContext.onActive;\n\n  var _React$useContext2 = React.useContext(PrivateContext),\n      _internalRenderSubMenuItem = _React$useContext2._internalRenderSubMenuItem;\n\n  var _React$useContext3 = React.useContext(PathUserContext),\n      isSubPathKey = _React$useContext3.isSubPathKey;\n\n  var connectedPath = useFullPath();\n  var subMenuPrefixCls = \"\".concat(prefixCls, \"-submenu\");\n  var mergedDisabled = contextDisabled || disabled;\n  var elementRef = React.useRef();\n  var popupRef = React.useRef(); // ================================ Warn ================================\n\n  if (process.env.NODE_ENV !== 'production' && warnKey) {\n    warning(false, 'SubMenu should not leave undefined `key`.');\n  } // ================================ Icon ================================\n\n\n  var mergedItemIcon = itemIcon || contextItemIcon;\n  var mergedExpandIcon = expandIcon || contextExpandIcon; // ================================ Open ================================\n\n  var originOpen = openKeys.includes(eventKey);\n  var open = !overflowDisabled && originOpen; // =============================== Select ===============================\n\n  var childrenSelected = isSubPathKey(selectedKeys, eventKey); // =============================== Active ===============================\n\n  var _useActive = useActive(eventKey, mergedDisabled, onTitleMouseEnter, onTitleMouseLeave),\n      active = _useActive.active,\n      activeProps = _objectWithoutProperties(_useActive, _excluded2); // Fallback of active check to avoid hover on menu title or disabled item\n\n\n  var _React$useState = React.useState(false),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      childrenActive = _React$useState2[0],\n      setChildrenActive = _React$useState2[1];\n\n  var triggerChildrenActive = function triggerChildrenActive(newActive) {\n    if (!mergedDisabled) {\n      setChildrenActive(newActive);\n    }\n  };\n\n  var onInternalMouseEnter = function onInternalMouseEnter(domEvent) {\n    triggerChildrenActive(true);\n    onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({\n      key: eventKey,\n      domEvent: domEvent\n    });\n  };\n\n  var onInternalMouseLeave = function onInternalMouseLeave(domEvent) {\n    triggerChildrenActive(false);\n    onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({\n      key: eventKey,\n      domEvent: domEvent\n    });\n  };\n\n  var mergedActive = React.useMemo(function () {\n    if (active) {\n      return active;\n    }\n\n    if (mode !== 'inline') {\n      return childrenActive || isSubPathKey([activeKey], eventKey);\n    }\n\n    return false;\n  }, [mode, active, activeKey, childrenActive, eventKey, isSubPathKey]); // ========================== DirectionStyle ==========================\n\n  var directionStyle = useDirectionStyle(connectedPath.length); // =============================== Events ===============================\n  // >>>> Title click\n\n  var onInternalTitleClick = function onInternalTitleClick(e) {\n    // Skip if disabled\n    if (mergedDisabled) {\n      return;\n    }\n\n    onTitleClick === null || onTitleClick === void 0 ? void 0 : onTitleClick({\n      key: eventKey,\n      domEvent: e\n    }); // Trigger open by click when mode is `inline`\n\n    if (mode === 'inline') {\n      onOpenChange(eventKey, !originOpen);\n    }\n  }; // >>>> Context for children click\n\n\n  var onMergedItemClick = useMemoCallback(function (info) {\n    onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));\n    onItemClick(info);\n  }); // >>>>> Visible change\n\n  var onPopupVisibleChange = function onPopupVisibleChange(newVisible) {\n    if (mode !== 'inline') {\n      onOpenChange(eventKey, newVisible);\n    }\n  };\n  /**\n   * Used for accessibility. Helper will focus element without key board.\n   * We should manually trigger an active\n   */\n\n\n  var onInternalFocus = function onInternalFocus() {\n    onActive(eventKey);\n  }; // =============================== Render ===============================\n\n\n  var popupId = domDataId && \"\".concat(domDataId, \"-popup\"); // >>>>> Title\n\n  var titleNode = /*#__PURE__*/React.createElement(\"div\", _extends({\n    role: \"menuitem\",\n    style: directionStyle,\n    className: \"\".concat(subMenuPrefixCls, \"-title\"),\n    tabIndex: mergedDisabled ? null : -1,\n    ref: elementRef,\n    title: typeof title === 'string' ? title : null,\n    \"data-menu-id\": overflowDisabled && domDataId ? null : domDataId,\n    \"aria-expanded\": open,\n    \"aria-haspopup\": true,\n    \"aria-controls\": popupId,\n    \"aria-disabled\": mergedDisabled,\n    onClick: onInternalTitleClick,\n    onFocus: onInternalFocus\n  }, activeProps), title, /*#__PURE__*/React.createElement(Icon, {\n    icon: mode !== 'horizontal' ? mergedExpandIcon : null,\n    props: _objectSpread(_objectSpread({}, props), {}, {\n      isOpen: open,\n      // [Legacy] Not sure why need this mark\n      isSubMenu: true\n    })\n  }, /*#__PURE__*/React.createElement(\"i\", {\n    className: \"\".concat(subMenuPrefixCls, \"-arrow\")\n  }))); // Cache mode if it change to `inline` which do not have popup motion\n\n  var triggerModeRef = React.useRef(mode);\n\n  if (mode !== 'inline' && connectedPath.length > 1) {\n    triggerModeRef.current = 'vertical';\n  } else {\n    triggerModeRef.current = mode;\n  }\n\n  if (!overflowDisabled) {\n    var triggerMode = triggerModeRef.current; // Still wrap with Trigger here since we need avoid react re-mount dom node\n    // Which makes motion failed\n\n    titleNode = /*#__PURE__*/React.createElement(PopupTrigger, {\n      mode: triggerMode,\n      prefixCls: subMenuPrefixCls,\n      visible: !internalPopupClose && open && mode !== 'inline',\n      popupClassName: popupClassName,\n      popupOffset: popupOffset,\n      popup: /*#__PURE__*/React.createElement(MenuContextProvider // Special handle of horizontal mode\n      , {\n        mode: triggerMode === 'horizontal' ? 'vertical' : triggerMode\n      }, /*#__PURE__*/React.createElement(SubMenuList, {\n        id: popupId,\n        ref: popupRef\n      }, children)),\n      disabled: mergedDisabled,\n      onVisibleChange: onPopupVisibleChange\n    }, titleNode);\n  } // >>>>> List node\n\n\n  var listNode = /*#__PURE__*/React.createElement(Overflow.Item, _extends({\n    role: \"none\"\n  }, restProps, {\n    component: \"li\",\n    style: style,\n    className: classNames(subMenuPrefixCls, \"\".concat(subMenuPrefixCls, \"-\").concat(mode), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-open\"), open), _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-active\"), mergedActive), _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-selected\"), childrenSelected), _defineProperty(_classNames, \"\".concat(subMenuPrefixCls, \"-disabled\"), mergedDisabled), _classNames)),\n    onMouseEnter: onInternalMouseEnter,\n    onMouseLeave: onInternalMouseLeave\n  }), titleNode, !overflowDisabled && /*#__PURE__*/React.createElement(InlineSubMenuList, {\n    id: popupId,\n    open: open,\n    keyPath: connectedPath\n  }, children));\n\n  if (_internalRenderSubMenuItem) {\n    listNode = _internalRenderSubMenuItem(listNode, props, {\n      selected: childrenSelected,\n      active: mergedActive,\n      open: open,\n      disabled: mergedDisabled\n    });\n  } // >>>>> Render\n\n\n  return /*#__PURE__*/React.createElement(MenuContextProvider, {\n    onItemClick: onMergedItemClick,\n    mode: mode === 'horizontal' ? 'vertical' : mode,\n    itemIcon: mergedItemIcon,\n    expandIcon: mergedExpandIcon\n  }, listNode);\n};\n\nexport default function SubMenu(props) {\n  var eventKey = props.eventKey,\n      children = props.children;\n  var connectedKeyPath = useFullPath(eventKey);\n  var childList = parseChildren(children, connectedKeyPath); // ==================== Record KeyPath ====================\n\n  var measure = useMeasure(); // eslint-disable-next-line consistent-return\n\n  React.useEffect(function () {\n    if (measure) {\n      measure.registerPath(eventKey, connectedKeyPath);\n      return function () {\n        measure.unregisterPath(eventKey, connectedKeyPath);\n      };\n    }\n  }, [connectedKeyPath]);\n  var renderNode; // ======================== Render ========================\n\n  if (measure) {\n    renderNode = childList;\n  } else {\n    renderNode = /*#__PURE__*/React.createElement(InternalSubMenu, props, childList);\n  }\n\n  return /*#__PURE__*/React.createElement(PathTrackerContext.Provider, {\n    value: connectedKeyPath\n  }, renderNode);\n}"],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